package com.shujia.day19;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.JSONPath;
import com.alibaba.fastjson2.JSONReader;

public class Demo03Fastjson {
    public static void main(String[] args) {

        Student student = new Student("李亮", 20, "男", "bigdata30");

        // TODO 注意当对象需要转成JSON或者字符串时，需要对当前对象中设置get set方法
        JSONObject stuJson = JSONObject.from(student);
        System.out.println(stuJson);

        String stuStr = JSON.toJSONString(student);
        System.out.println(stuStr);


    }
}
